package com.emm.yixun.openapi.hander;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.emm.yixun.common.model.User;
import com.emm.yixun.common.model.dto.OrgOaDataVo;
import com.emm.yixun.common.model.dto.ResponseOrg;
import com.emm.yixun.openapi.dto.base.BaseRequestDTO;
import com.emm.yixun.openapi.dto.base.BaseResponseDTO;
import com.emm.yixun.openapi.hander.base.CommonAbstractHander;
import com.emm.yixun.system.service.UserServiceFacade;
/**
 * Oa同步接口处理
 * @author Administrator
 *
 */
@Service("oaOrgHander")
public class OaOrgHander extends CommonAbstractHander{
    
    @Autowired
    private UserServiceFacade userServiceFacade;
    @SuppressWarnings("rawtypes")
    @Override
    public BaseResponseDTO doBusiness(BaseRequestDTO reqDto) {
	BaseResponseDTO<ResponseOrg> responseDTO = new BaseResponseDTO<ResponseOrg>();
	try {
	    OrgOaDataVo orgOaDataVo = (OrgOaDataVo)reqDto.getParams();
	    User user = userServiceFacade.findById(1L).getEntity();
	    responseDTO.setResData(userServiceFacade.orgData(orgOaDataVo, user).getEntity());
	} catch (Exception e) {
	    e.printStackTrace();
	}
	return responseDTO;
    }

}
